package com.augurit.gzcgwsp.ywcmn.web;

import java.util.List;

import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.beans.factory.annotation.Autowired;
import com.augurit.common.base.action.CrudActionSupport;
import com.augurit.common.base.form.ResultForm;
import com.augurit.gzcgwsp.ywcmn.service.IBaseDistrictService;
import com.augurit.gzcgwsp.ywcmn.web.form.BaseDistrictForm;
/**
 * 地区配置表
 * @author Administrator
 *
 */
@SuppressWarnings("serial")
@Results({
	@Result(name = CrudActionSupport.RELOAD, location = "base-district.action", type = "redirect")
})
public class BaseDistrictAction extends CrudActionSupport<BaseDistrictForm>{

	@Autowired
	private IBaseDistrictService baseDistrictService;
	
	public String getStreet(){
		String parentDistrictId = this.getParameter("PId");
		List list = baseDistrictService.getValue(parentDistrictId);
		this.renderJson(new ResultForm(false, list));
		//this.renderJson(list);
		return null;
	}
	
	public String getDistrictName(){
		Long districtId = Long.parseLong(this.getParameter("districtId"));
		String districtName = baseDistrictService.get(districtId).getDistrictName();
		this.renderJson(districtName);
		return null;
	}
	
	public String getStreetName(){
		
		return null;
	}
	@Override
	public String delete() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String deleteMore() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String list() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected void prepareModel() throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public String save() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	public BaseDistrictForm getModel() {
		// TODO Auto-generated method stub
		return null;
	}

}
